<?php

namespace App\Models\Posts;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class WxComment extends Model
{
    use HasDateTimeFormatter;
//    use SoftDeletes;

    protected $table = 'wx_comment';

    /**
     * 获取该评论的所属文章
     */
    public function post()
    {
        return $this->belongsTo(WxPost::class,'posts_id','id');
    }


    public function getFormatTimeAttribute()
    {
        return format_datetime($this->created_at);

    }

}
